﻿
using Microsoft.SemanticKernel;
using Share;

var kernel = Kernel.CreateBuilder()
    .AddOpenAIChatCompletion(
        modelId: "gpt-3.5-turbo", apiKey: "sk-9gH1lRVZemdh4eStDMJllCSLLt9VTq4ls18orr",
        httpClient: new HttpClient(new OpenAIHttpClientHandler("https://api.token-ai.cn/")))
    .Build();

await foreach (var item in kernel.InvokePromptStreamingAsync("Hello，我是 AI"))
{
    Console.Write(item.ToString());
}